<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>控制器嵌套nesting</title>
    <script src="../../lib/angularjs/angular.js"></script>
</head>
<body ng-app="app01">
    <div ng-controller="parentController">
        <div ng-controller="childrenController">
            <button ng-click="say()">say</button>
        </div>
        {{person}}
    </div>
    <script>
        var app=angular.module("app01",[]);
        app.controller("parentController",function ($scope) {
            $scope.person={name:"张三"};
        })
        app.controller("childrenController",function ($scope) {
            $scope.say=function () {
                $scope.person.name="李四";
            }
        })
    </script>
</body>
</html>